Research on Named Entity Recognition Method of Metro On-Board Equipment Based on Multiheaded Self-Attention Mechanism and CNN-BiLSTM-CRF

Massive and complex unstructured fault text data will be generated during the operation of subway trains. A named entity recognition model of subway on-board equipment based on Multiheaded Self-attention mechanism and CNN-BiLSTM-CRF is proposed to address the issue of low recognition accuracy and incomplete recognition features of unstructured fault data named entity recognition task of subway on-board equipment: BiLSTM-CNN parallel network extracts context feature information and local attention information, respectively; In the MHA layer, the features learned from different dimensions are fused through the Multiheaded Self-attention mechanism, and the dependencies of various ranges in the sequence are captured to yield the internal structure information of the features. The conditional random field CRF is used to learn the internal relationship between tags to ensure their sequence. This model is tested with other named entity recognition models on the marked subway on-board fault data. The experimental results demonstrate that this model is able to recognize 10 kinds of labels in the dataset. Moreover, the recognition effect of each label has a good performance in the three evaluation indexes of P, R, and F1 score. Moreover, the weighted average evaluation indexes Avg − P, Avg − R, and Avg − F1 of 10 labels in this model reach the highest 95.39%, 95.48%, and 95.37%, which has high evaluation indexes and can be applied to the named entity recognition of Metro on-board equipment.


Introduction
Subway on-board equipment is the basic piece of equipment guaranteeing the safe operation of the subway train. Onboard equipment is also constantly upgraded owing to the rapid development of China's urban rail transit. With the accumulation of subway operation mileage and operation time, a consequential amount of fault data about on-board equipment has been generated. ese data record the detailed fault information in the form of text, containing useful knowledge of fault diagnosis and processing. However, given that it is stored in the form of unstructured text, it is not conducive for computer processing and understanding. It has long been delved into by field engineers and technicians who suggest that the fault knowledge cannot be reused efficiently. erefore, for these large amounts of unstructured subway fault knowledge, knowledge entities should be efficiently identified and integrated, the fault cases and treatment methods in the fault knowledge should be identified, the subway knowledge map should be built, and field personnel should be provided with accurate subway fault information. e human-computer interaction platform provides field personnel with three kinds of information: subway fault information, fault causes, and other knowledge information. Moreover, the named entity recognition task related to subway on-board equipment also establishes a knowledge base to serve subway fault diagnosis, subway train information service, and subway information intelligent recommendation [1].
Named entity recognition (NER) [2] is an essential component of natural language processing (NLP) [3]. It aims to identify various named entities from the original text, such as name, location, and organization. It can subsequently extract the concerned information in the fault text data as named entities [4]. e extracted entities can subsequently pave the way for other NLP tasks. e methods of named entity recognition mainly include rule-based methods, statistics-based methods, and deep learning-based methods: Pan [5,6] constructed the rule base of named entity recognition and used the method of rule matching to identify named entities. However, the rule writing based on rules and dictionary methods requires the involvement of domain experts, thereby requiring high language knowledge and poor portability. erefore, statistical machine learning was employed to deal with the NER problem. In statistical machine learning, the main algorithms suitable for sequence annotation tasks are: Hidden Markov models (HMM) [7,8], Maximum Entropy Markov models (MEMM) [9], conditional random field (CRF) [10], etc. However, the method based on machine learning requires a substantial amount of labeled data to train the model, requiring significant manpower, thereby leaving much room for improvement in recognition accuracy. In recent years, deep neural network has been used to realize the key tasks in the knowledge map due to the advent of deep learning technology [11], garnering extensive attention. e use of named entity recognition technology to identify entities in subway operation and maintenance logs is a basic step in the conversion of subway fault text into structured data, thereby laying a foundation for mining and developing the rich knowledge contained in a large amount of fault data recorded during subway operation [12]. e current mainstream deep learning solutions tend to embed layer and Bidirectional long short-term memory (BiLSTM) layer, allowing the machine to directly learn the features. It subsequently directly inputs the learned features into CRF, thereby circumventing the tedious task of manually formulating the feature function [13]. Literature [14,15] uses the neural network model to learn the internal representation of text on a large number of unmarked datasets, which does not require the setting of artificial features. Literature [16] adopts the long short-term memory (LSTM) neural network model, boosting the performance of word segmentation. However, this method cannot yield the semantic information behind the sentence. Literature [17,18] proposes that CRF is used as the processing mode of output processing layer on the basis of bidirectional LSTM, effectively improving the performance of the model. Furthermore, convolutional neural network (CNN) [19] has also achieved desirable results in solving NER problems; literature [20] uses CNN to obtain multilevel features, thereby yielding local attention information and improving the sensitivity of entity boundary information; literature [21] adopts the serial strategy of CNN and LSTM-CRF to recognize the named entity of the conll2003 English dataset, and obtains a higher F1 value. However, LSTM network cannot capture text information in both directions. Document [22] uses the Bidirectional gate recurrent unit (BiGRU) and CRF combined with CNN for named entity recognition, and uses the connection vector including affix vector, part of speech vector, and word vector as input. It ultimately outputs through the CRF layer, which can address the issue of automatic named entity recognition and exert a desirable effect on entity recognition. Document [18] proposed a method to fuse character and word vectors. It adopted the Chinese named entity recognition method of BiLSTM-CRF to effectively extract two features at character and word level, thereby effectively improving the accuracy of named entity recognition. Literature [23] adopts the BERT-CRF model, extracts the global features of the input sequence through the Bert pretraining model, adds the CRF layer at the end of the model, introduces hard constraints, and constructs the model framework of named entity recognition. However, the Bert model has a lengthy pretraining time, and it is only used as a transfer learning model, which is hindered by insufficient information recognition ability for small areas. Much research has been conducted in the field of railway text data analysis. In terms of named entity recognition, Yang [24] used word2vec to represent the characteristics of railway accident faults, and used BiLSTM-CRF to realize the named entity recognition of railway electrical service accident faults. Literature [17] uses BiLSTM-CRF to realize the named entity recognition of high-speed railway signal equipment and puts forward the entity relationship representation method of multidimensional word segmentation features, thereby achieving high evaluation indexes for the task of named entity recognition of high-speed railway signal equipment.
Based on the above literature research, this paper proposes a named entity recognition method for Metro on-board equipment based on multiheaded self-attention (MHA) and BiLSTM-CNN-CRF. e core idea of the method is as follows: (1) YMDAA is used to complete the sequence annotation [25], and the location, phenomenon, and measure of the fault in the subway on-board fault text are marked and exported in an Ann format file. e file is subsequently read through Python and added to the BMEO label to complete the preannotation of fault text data.
(2) e tag and word sequence of the prelabeled fault text are input into the word2vec model and transformed into feature vectors. e strategy of CNN and BiLSTM working in parallel is adopted, whereby CNN and BiLSTM work simultaneously, extract the context and local attention features in the fault text, respectively, and ultimately fuse the two kinds of information. (3) e multihead self-attention mechanism is adopted to give higher weight to the more important information in the input word sequence and label sequence. is mechanism can boost the sensitivity of the machine towards important information, mining the association between different input features to extract the feature vector containing other word information. e recognition ability of the machine to feature information can be more comprehensive by defining the number of heads of multiple groups of attention mechanisms, extracting important features from different dimensions, and splicing and linear processing these features [26].

Design of Named Entity Recognition Model Based on Multihead Self-Attention Mechanism and BiLSTM-CNN-CRF
Based on the multiheaded self-attention mechanism and BiLSTM-CNN-CRF, the named entity recognition model architecture of Metro on-board equipment is illustrated in Figure 1. It includes four main layers: word embedding layer, BiLSTM-CNN layer, MHA layer, and CRF layer.
In the word embedding layer, the subway on-board fault database is first loaded, the fault text records in the database are marked with BMEO through YMMDA, the word vector of large-scale marked text is subsequently trained in the same field as word2vec. e generated word vector is then input into the BiLSTM module and CNN module in the BiLSTM-CNN layer, respectively. e BiLSTM module is used to learn the time characteristics and context information of the text sequence, e CNN module is used to extract the local features in the text. e outputs of BiLSTM and CNN are then spliced and fed to the MHA layer to yield the global features of the text sequence and the correlation strength between words. Finally, the CRF layer marks the output sequence from the MHA layer according to the importance of the features and outputs the entity prediction label.

Word Embedding Layer.
Data preprocessing is first performed on the prelabeled subway on-board fault text, which is subsequently segmented. Stop words and lowfrequency words are then discarded. e accuracy of word segmentation exerts a direct impact on the training effect of the model, while the Jieba word segmentation tool may fail to identify some proper nouns in this field. erefore, a dictionary of proper nouns in the subway on-board field should be defined according to relevant data and existing knowledge, to improve the reliability of word segmentation task and lay a foundation for the vectorization of text [27].
In this paper, word2vec model is used to train word vectors, transforming large-scale subway vehicle fault text and label data into low dimensional and dense word vectors.
is model can reflect the relationship between words but does not necessarily ensure sufficient training of proper nouns. To address this issue, word2vec is used to train word vectors on the training set data and other corpora in the field. Word2vec trains the word vector through the skip gram model, whereby the central word predicts the words around it and solves the context word vector through the conditional probability value of the intermediate word vector, to fully learn the semantic vector representation [28]. Suppose the sample S is composed of n sentences, input the text sequence S � [s 1 , s 2 , · · · , s n ], the i sentence in the text sequence is represented as s i � [w i1 , w i2 , · · · , w ik ], whereby k represents the number of words contained in the sentence s i , and w ik represents the k word in the i sentence. e skip gram model converts the input text sequence into word vector, and further generates the corresponding word vector matrix. W ij represents the j word vector in the i sentence, and the word vector matrix of the sentence s i with the length of k is represented as Finally, E � [W 11: 2k , W 21: 2k , W 31: 3k , · · · , W n1: nk ], the word vector matrix spliced by n sentences in the sample S, is used as the output of the word embedding layer.

BiLSTM-CNN Layer.
is layer adopts the strategy of BiLSTM and CNN working in parallel, whereby the feature vectors generated by word2vec are input to BiLSTM and CNN networks, respectively; the context features and local attention features are extracted respectively; and the two fusion features are subsequently input to the MHA layer.

BiLSTM. LSTM effectively calculates and controls the input and output of information by designing gating units in neurons.
e design of this gating unit addresses the problem of text sequence length dependence. Its structure is illustrated in Figure 2. e information of cell state C t−1 is transmitted through the top straight line. e hidden layer state h t and input x t at t time will modify C t appropriately and then output to the next time. Moreover, C t−1 will participate in the calculation of h t output at t time, and alter the cell state through the gate structure of LSTM. After connecting h t−1 and x t , calculate with different weight matrices and o t respectively. e calculation formula is shown in (1)-(3). e amount of information needed to be forgotten from the previous hidden layer h t−1 is controlled by multiplying f t and C t−1 ; the content is planned to (−1, 1) through the function, so that the updated cell C t is multiplied with i t to control which information needs to be retained. e calculation is shown in formula (4), where W C denotes the weight matrix. When the information in the cell state C t is completely updated, as shown in formula (5), it is scaled by tanh and multiplied by o t to output h t as the next LSTM hidden layer state. e calculation is shown in formula (6).
However, given that the unidirectional LSTM model can only capture the information before the sequence and cannot capture the context semantics, Li et al. [27] improved the RNN model to yield the LSTM, which can solve the problems of gradient disappearance and gradient explosion that could occur in the process of long sequence training. BiLSTM is composed of forward propagating LSTM and back propagating LSTM. It captures the above and below Computational Intelligence and Neuroscience information of the current text, respectively, and then combines the feature information extracted from the two directions to yield the text features of remembering the past and the future. e word vector matrix E obtained through the word embedding layer is input to the BiLSTM part in the BiLSTM CNN layer as illustrated in Figure 1. e LSTM forward propagation generates the forward hidden layer state sequence: , and the reverse hidden layer state sequence: ]. e forward hidden layer state sequence H 1 is spliced with the reverse hidden layer state sequence H 2 to obtain the com- where m represents the dimension of the BiLSTM input word vector.
is combination of forward and reverse states gives full play to the advantages of BiLSTM and addresses the issue whereby the traditional one-way LSTM model fails to capture the context information. It fully combines the context and extracts the features through the overall environment, which can substantially mitigate feature loss. e hidden layer state sequence H t � [h 1 , h 2 , . . . , h m ] is the final output of the BiLSTM layer and is input to the MHA layer.

CNN.
e word vector matrix set generated by the word embedding layer is input to the CNN layer. e CNN layer includes two steps: convolution and max pooling. Its working process is depicted in Figure 3. Convolution is the   use of different sizes of convolution to check the input eigenvector matrix for feature calculation, and then extracting the local feature information of the text. e operation process of convolution can be expressed as follows: where c i denotes the ith eigenvalue of the text output through convolution operation; F represents the matrix corresponding to the convolution kernel; f is a nonlinear activation function; · indicates that the two matrices are multiplied by points; W i: j represents the word vector matrix from i word to j word; and b is the offset term. Convolution operation on the characteristic matrix of each word vector is carried out in the input, and the characteristic graph c is calculated through formula (8).
e pooling layer samples the text features by setting a fixed step stripe. In this paper, the maximum pooling strategy max pooling is used for pooling processing. is process aims to effectively extract the local key information in the sequence, compress the input feature map, reduce the size of the feature map c, to simplify the network calculation, and finally calculate the output fixed length vector C t through formula (9).
2.3. MHA Layer. e output H t of BiLSTM network and the output C t of CNN network are spliced into a feature vector X t with a dimension of 320 (the dimension of feature vector H t is 256 and the dimension of feature vector C t is 64). However, this feature vector cannot display the importance of key information in the context, which could entail the loss of important information in the named entity recognition task. erefore, the introduction of the multiheaded selfattention mechanism is essential to learn the dependence between any two words in the sentence, obtain the internal structure information, and distinguish the significance of each word. e calculation principle of self-attention mechanism is illustrated in Figure 4.
Taking the feature x 1 in X t as an instance, the self-attention mechanism initializes the W Q , W K , and W V matrices, and obtains Q n , K n , and V n matrices, respectively, by multiplying with the input feature x 1 points, as shown in formula (10). It then calculates the attention a 1n from formula (12) to represent the correlation degree between the feature x 1 and the feature x n .
Among them, Q n represents the query matrix, K n represents the key value matrix, V n represents the score matrix, and n is the serial number corresponding to other input features. rough the combination of a 1n and V n , the association head 1n between x 1 and other different features is obtained. e calculation is shown in formula (12). All the feature vectors head 1n are added and the Z 11 vector is calculated and can represent the connection between the first word and other words through formula (12).
e MHA calculation principle is depicted in Figure 5, whereby the multiple groups of W Q , W K , and W V matrices are initialized, multiple groups of Q, K, and V characteristic matrices are generated through point multiplication, thereby yielding multiple groups of Z 1t . After completing the splicing of multiple groups of Z 1t , the dimension is reduced through linear transformation, whereby t denotes the number of self-attention heads, to obtain Z 1 containing other feature information. MHA linearly maps the input features to different information subspaces through different weight matrices, and calculates the same attention function Computational Intelligence and Neuroscience 5 in each subspace, thereby expanding the ability of the model to consider different positions, to fully understand the structure and semantics of sentences. e output x 1 ′ of the final MHA is calculated by the tanh function from Z 1 and the input characteristic x 1 , as shown in formula (14). e MHA value of other features x n in X t is calculated as above.
2.4. CRF Layer. BiLSTM only considers the long-term dependency information of sentences but overlooks the dependency between tags. For instance, in the entity tags defined in this paper, b-phenomenon cannot appear after the m-phenomenon. erefore, CRF needs to be introduced to learn the internal relationship between tags to ensure the sequence of tags. e conceptual diagram of CRF conditional random field is depicted in Figure 6. e conditional random field model, CRF, is based on the calculation of a given random variable sequence X � (x 1 , x 2 , · · · , x n ). e conditional probability distribution of the random variable sequence Y � (y 1 , y 2 , · · · , y n ) is P(X|Y), and n denotes the sequence length. e model assumes that the random variable sequence satisfies the Markov property: P(X|Y) can subsequently represent the linear chain conditional random field. In the labeling problem, X represents the input observation sequence, Y represents the corresponding output mark sequence or state sequence, and the evaluation score Score(X, Y) can be obtained through formula (16).
whereby W represents the transition matrix, and W i,j represents the state transition score from the i character to the j character. P denotes the weight matrix output by the decoding layer, P i,y i represents the probability that the ith word is marked as y i , and exp represents the exponential function of the natural constant e. Assuming that the input sentence feature is X, the probability distribution of the output sequence y ′ is P(y ′ |X). Finally, the maximum probability is yielded by the maximum likelihood estimation in the process of fitting the model. e calculation process is shown in formula (17).

CRF Layer.
e named entity recognition method of subway on-board equipment requires the deep learning method of supervised learning. erefore, the sample data labeling is required before training. According to the fault knowledge structure, the fault text data of each Metro onboard equipment define three types of named entities: fault location, fault phenomenon, and fault solution. e named entity identification sequence is represented by BMEO, where B (begin) represents the starting position of the entity, M (middle) represents the middle part of the entity, and E (end) represents the end character of the entity, O (other) represents a nonentity character, and "−" is used to connect the sequence annotation symbol with the defined entity type. erefore, this paper selects the fault text data recorded in the depot of a subway company from 2016 to 2021 according to the functions and fault characteristics of each equipment. After preprocessing these fault text data, the total amount of data is 51652 marked data, divided into the training set, development set, and test set; 41526 pieces of data are selected as the training set data as the data samples of model fitting; 5035 pieces of data are development set data, which are used to adjust parameters, select features, and make other decisions on learning algorithms; 5091 pieces of data are test set data, used in model evaluation. e knowledge annotation of some data in this paper and the process of input to the model in this paper are illustrated in Figure 7.

Experimental Evaluation Index.
In this paper, the Precision, Recall, and F 1 − Score are used as the evaluation indexes of this experiment, whereby TP represents the number of samples classified and divided correctly; FP represents the number of samples classified and divided incorrectly; FN indicates the number of unclassified samples, which are wrong.

Precision.
e accuracy rate is only for the positive samples with correct prediction, as opposed to all samples with correct prediction. It is calculated by dividing the number of positive samples with correct prediction by the ratio of the number of positive samples predicted by the model. It shows that the predicted positive samples are really positive, as shown in formula (8):

Recall.
It is calculated by dividing the predicted correct number of positive samples by the actual number of positive samples in the test set; it shows that the number of samples that are really positive can be recalled by using the classifier, as shown in formula (9): 3.2.3. F1-Score. F 1 − Score is the harmonic average of accuracy rate and recall rate. Both Precision and Recall are expected to be higher; however, both these indicators are contradictory and cannot both be high. erefore, F 1 − Score should be introduced as an appropriate threshold point to maximize the ability of the classifier, as shown in formula (10):

Weighted Average.
In this paper, the evaluation indexes Avg − P, Avg − R, and Avg − F 1 are defined as the weighted average values of 10 entity labels' Precision, Recall, and ,F 1 − Score respectively. e calculation process is shown in formula (21).
Where i denotes the value corresponding to the entity category (there are 10 named entity categories in this paper), N i represents the number of entities in this category, and P i , R i , and F i represent Precision, Recall, and F 1 − Score corresponding to class i entities, respectively.

Experimental Environment.
e experimental hardware includes a i7-6700HQ CPU, a GTX960M graphics card, a video memory of 8G, a Win10 64bit operating system, a 3.60 python version, a Spider 5.0.5 development tool, and a 1.11.1GPU Pytorch version.

MHA Attention Heads Number Selection and Other Parameter Settings.
e number of attention heads is set to t in the MHA layer. During the operation of the MHA layer, the input features need to be divided into t parts, and the dimension of the feature vector X t input to the MHA layer is 320. It is necessary to ensure that the set number of attention heads' t value is divisible by 320. erefore, this paper selects MHA with the number of attention heads of 2, 4, 5, 8, and 10 to test the model in this paper, and the experiment uses all the parameters in Table 1 except attention_heads, and the optimizer chosen is Adam.
It can be inferred from Figure 8 that after the addition of the multihead self-attention mechanism, the prediction results of the model gradually improves with the increase of the number of self-attention heads; when the head is 8, the Avg − P, Avg − R, and Avg − F 1 of the model reach the optimum, and the Avg − F 1 of the model is increased by 0.52%, 0.46%, and 0.34%, respectively, compared to the number of self-attention heads of 2, 4, and 5. By further increasing the number of heads, the accuracy of the model decreases. is finding arises because an excessive number of attention heads will lead to overfitting of the model. e Computational Intelligence and Neuroscience number of MHA attention heads is set to 8, and the parameter settings are shown in Table 1.

Optimizer
Selection. In the deep learning task, the optimizer is used to update and calculate the network parameters affecting the model training and model output, to approximate or reach the optimal value, and to minimize (or maximize) the loss function. In this experiment, five commonly used optimizers are selected: SGD (stochastic gradient descent), momentum optimization method, adaptive learning rate optimization algorithm Adagrad, RMSprop, and Adam. SGD selects a mini batch each time and uses the gradient descent to update the model parameters; Momentum optimization method adds the momentum optimization mechanism based on SGD. e Adagrad algorithm automatically attenuates the learning rate by using the number of iterations and cumulative gradient; RMSprop adds iterative attenuation; e Adam optimizer dynamically adjusts the learning rate of each parameter by using the firstorder moment estimation and second-order moment estimation of the gradient [28]. In this experiment, the five optimizers are applied to the named entity recognition training task of this model. e parameter values set in Table 1 are used as the parameter values of this experiment, and e alpha of RMSprop is 0.99 and eps is 1e − 08; the beta1 of Adam is 0.9, beta2 is 0.999, and eps is 1e − 08, and the rest of the optimizers are the system default parameters.
In the process of model training, the variation of loss function value loss with iteration step in the 5th, 10th, 15th, 20th, and 25th epoch rounds is shown in Figures 9(a) to 9(e), respectively. Adam and RMSprop have the smallest loss function value and stable iterative waveform, while Adam showcases better performance in these two aspects. erefore, Adam is selected for subsequent experiments in this paper. Moreover, it can be inferred that with the increase of training rounds epoch and training samples in each round, the loss function value loss constantly declines, and finally tends towards   Computational Intelligence and Neuroscience stability and 0, indicating that the parameter values in Table 1 optimizes the network training of this model.

Experimental Super Parameter Optimization.
Several common named entity recognition models in NLP field are used to train the dataset in this paper. After 25 rounds of epoch, the recognition results of 10 entity labels in this paper are generated, as listed in Table 2 respectively. e following comparative analysis is carried out: e recognition results of phenomenon are shown in Table 2. e F1 values of HMM model for BME of phenomenon are 65.52%, 80.33%, and 71.93%, respectively. Compared with (Table 3) CRF model, the F1 value of HMM model for entity (Table 4) label b-phenomenon is 4.81% lower, the F1 value of m-phenomenon is 2.01% lower, and the F1 value of e-phenomenon label is 4.99% lower. ese findings arise as the limitation of HMM model is that it uses the trained local model to make a global prediction. e independent BiLSTM model is slightly better than the CRF model for the recognition of these three named entities, and the F1 value of Table 5 phenomenon's BME is increased by 2.61%, 2.87%, and 0.97%, respectively, because the single CRF model can only capture the internal relationship between named entities within a certain range. It fails to capture long-distance previous and subsequent information. However, the disadvantage of BiLSTM is that it has a general learning effect on the internal relationship between tags, which can be compensated by combining it with the CRF model. erefore, the F1 value of BiLSTM CRF for entity tag b-phenomenon and e-phenomenon is increased by 0.33% and 1.87%, respectively, compared with BiLSTM, and the p value of entity tag m-phenomenon is increased by 3.75%. BiLSTM-CNN-CRF adds a CNN network based on BiLSTM-CRF. e output results of CNN and BiLSTM are fused into the CRF network to complete the named entity work and boost the extraction ability of local features. erefore, the F1 value of BME named entities of phenomenon is increased by 1.4%, 1.63%, and 3.45%, respectively, compared with BiLSTM-CRF, and 1.73%, 0.9%, and 5.23%, respectively, compared with BiLSTM. Moreover, the P and R values are also improved to varying degrees. BiLSTM-CNN-MHA-CRF adds MHA based on BiLSTM-CNN-CRF to learn the dependency between any two words in the sentence and yields the internal structure information.
e F1 value of BME three named entities has increased by 0.33%, 1.46%, and 0.83%, respectively. Although the p value has decreased slightly, the R value has increased by about 4-5 percentage points compared with BiLSTM-CNN-CRF, with a more balanced recognition effect of phenomenon entities.
Most location type named entities correspond to station names, place names, or section names, with relatively fixed names. erefore, the six models have good recognition effects on location type named entities. e P, R, and F1 of BiLSTM-CNN-MHA-CRF have reached over 90%. Compared with the other five models, the p values for BME tag recognition of location are 97.37%, 94.27%, and 94.87%, respectively, which are the highest values. Also, the F1 values have reached the highest at 93.67%, 92.79%, and 92.50%, respectively. e recognition effect on the next three BME entity tags is relatively balanced. e recognition effect of three named entity labels of BME of measure is shown in Table 4.
e F1 value of b-measure in this paper is only second to BiLSTM-CNN-CRF and BiLSTM-CRF, at 86.73%. e recognition effect of E-MEASURE is general, with P, R, and F1 values of 89.58, 81.69, and 85.45%, respectively. e reason is that the number of these two entity labels is the least, resulting in insufficient learning of these two types of labels in the main model and the inability to play the role in MHA mechanism. However, for the largest number of entity tags with a complex structure, the P recognized by the m-measure is 96.23%, which is 4-19 percentage points higher than other models.
e F1 value reached 91.07%, which is also the highest value among the six models, which is 5-13 percentage points higher than other models. e recognition effect of other nonentity tags o is shown in Table 5. Tag O indicates a type of the label o, as the largest number of 10 tag types, the P, R and F1 values of the proposed six models exceed 94%, while the recognition effect of this model is slightly better. e P, R, and F1 values reach 96.37%, 98.87%, and 97.60%, respectively, and the F1 value is 0.6-2 percentage points higher than that of other models.
To sum up, for the identification of the above 10 Tags, the other five models except the model in this paper have relatively good recognition effects on BME entity tag and nonentity tag o in location. Also, the model in this paper has better recognition effects on these types of tags. e recognition effect of phenomenon's BME entity label is relatively poor, as the description of fault phenomenon will be detailed to each component. Given the numerous components of subway on-board equipment, the description of fault phenomenon is relatively complex, and the model fitting is more complex. Using the model proposed in this paper, the F1 value recognized by BME tag and m-measure tag of phenomenon is substantially improved, and the F1 value recognized by b-phenomenon is about 0.4-10 percentage points higher than that of other models. e F1 value of m-phenomenon increased by about 1.4-7 percentage points; the F1 value of e-phenomenon increased by about 2-4 percentage points; the F1 value of m-measure increased by about 5-13 percentage points. Due to the insufficient number of b-measure and E-MEASURE entity labels, the recognition effect of this model on b-measure and E-MEASURE entity labels is general; however, this model improves the recognition effect of 8 entity labels except for b-measure and E-MEASURE.

Overall Recognition Effect.
Further comparison of the weighted average evaluation indexes Avg − P, Avg − R, and Avg − F 1 of the six models on the recognition results of 10 labels. As depicted in Figure 10 and Table 6, in terms of Avg − P, Avg − R, and Avg − F 1 , the combined model IV-VIII outperforms I, II, and III. Compared with IV, V, and VI, Avg − P, Avg − R, and Avg − F 1 of V are increased by 0.3%, 0.25%, and 0.27%, respectively, compared with and those of VI is increased by 0.53%, 0.46%, and 0.49%, respectively, compared with IV, indicating that adding CNN can improve the ability of extracting local features. e introduction of MHA largely makes up for the lack of BiLSTM's ability to capture the association relationship between words when processing long sequences and can capture various semantic features and highlight the key information of characters, the level of words and sentences. erefore, the Avg − P, Avg − R, and Avg − F 1 of VIII are 0.57%, 0.6%, and 0.66% higher than those of VI, respectively, and the Avg − P, Avg − R, and Avg − F 1 of VIII are the highest among the six models, 95.39%, 95.48%, and 95.37%, respectively. Both V and VII models connect BiLSTM and CNN in series, whereby the word vector generated by  Table 3: Recognition effect of different named entity recognition models on location.     Word2Vec is first input to BiLSTM. e output of BiLSTM is subsequently used as the input of CNN. Compared with V, VI, VII, and VIII, VI has increased by 0.23%, 0.21%, and 0.22%, respectively, in three indexes compared with V; VIII compared with VII, the three indexes are increased by 0.26%, 0.33%, and 0.43%, respectively, indicating that the effect of parallel work of BiLSTM and CNN outperforms serial work. erefore, adopting the strategy of BiLSTM and CNN working in parallel and effectively combining MHA and BiLSTM-CNN-CRF can improve the recognition effect compared with other named entity recognition models, which is of great significance to improve the overall performance of the named entity recognition model of Metro on-board equipment.

Conclusion
Based on unified labeling of Metro on-board equipment fault text data, aimed at solving the problem of low accuracy of naming entity recognition task of unstructured Metro onboard fault data, this paper proposes a Metro on-board equipment naming entity recognition model based on multihead self-attention mechanism and CNN BiLSTM CRF. Compared with the traditional naming entity recognition model BiLSTM CRF, this model adds a CNN network with parallel processing characteristics with BiLSTM. e two extracted features are combined and sent to MHA, which extract the context information and local feature information, and mine the internal relationship between different features through MHA.
is paper defines the entity tag BME and other nonentity tags o corresponding to the three types, through the named entity recognition experiment of Metro on-board equipment fault text data with this model and other common named entity recognition models, and the experiment results show that: (1) e proposed named entity recognition model has conspicuous advantages in the three indexes of P, R, and F1 for the recognition results of all tags except entity tag b-measure and E-MEASURE, which is higher than HMM, CRF, BiLSTM, BiLSTM-CRF, and BiLSTM-CNN-CRF.
(2) e model in this paper has a good performance in the weighted average evaluation indexes Avg − P, Avg − R, and Avg − F 1 , reaching 95.39%, 95.48%, and 95.37%, respectively. It is the highest value when compared with the other five named entity recognition models. Moreover, the strategy of parallel work of BiLSTM and CNN outperforms serial work.
erefore, it can meet the performance requirements of high accuracy of subway on-board equipment fault text named entity recognition, provide theoretical basis and application value for subway on-board equipment fault named entity recognition, and establish a good foundation for the subsequent establishment of subway on-board knowledge map and the subway on-board knowledge base.
Data Availability e dataset can be obtained from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.